﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserList.aspx.cs" Inherits="Com.CMS263.Web.manage.UserManager.UserList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../style/main.css" rel="stylesheet" type="text/css" />
    <link href="../common/validator.css" rel="stylesheet" type="text/css" />

    <script src="../../js/jquery-1.4.2.min.js" type="text/javascript"></script>

    <script type="text/javascript">
        function edits(id) {
            window.location.href = "UserEdit.aspx?id=" + id + "&&page=<%=page%>";
        }
        function del(id, obj) {
            if (confirm('这是一个不可逆的操作，真的要删除此条记录')) {
                $.post("user_action.aspx?op=delUser", { id: id }, function(data) {
                    if (data == "ok") {
                        alert('删除成功');
                        $(obj.parentNode.parentNode).remove();
                    }
                })
            }
        }
        $(function() {
            $("#tab tr").mouseover(function() {
                $("#tab tr").attr("className", "")
                $(this).attr("className", "asd01")
            })
        })
    </script>

</head>
<body>
    <form id="form1" action="UserList.aspx" runat="server" enctype="multipart/form-data"
    method="post">
    <input type="hidden" id="page" name="page" value="<%=page%>" />
    <div id="userlist">
        <table width="96%" border="0" align="center" cellpadding="0" cellspacing="0" class="table_1">
            <tr>
                <td height="23" class="table_2">
                    用户管理
                </td>
            </tr>
            <tr>
                <td>
                    用户管理&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <input type="text" id="username" name="username" value='<%=username%>' />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <input type="submit" id="submit" value="搜索" style="width: 50px" />
                </td>
            </tr>
            <tr>
                <td class="tdside" align="center">
                    <table width="100%" id="tab" border="0" align="center" cellpadding="0" cellspacing="0"
                        class="table_1">
                        <tr>
                            <td>
                                序号
                            </td>
                            <td>
                                用户名
                            </td>
                            <td>
                                邮箱
                            </td>
                            <td>
                                手机号
                            </td>
                            <td>
                                电话
                            </td>
                            <td>
                                注册时间
                            </td>
                            <td colspan="4">
                                操作
                            </td>
                        </tr>
                        <% if (cusList.Count > 0)
                           {
                               foreach (Com.CMS263.PO.CustomerList item in cusList)
                               { 
                        %>
                        <tr>
                            <td>
                                <%=item.Id%>
                            </td>
                            <td>
                                <%=item.UserName%>
                            </td>
                            <td>
                                <%=item.UserEmail%>
                            </td>
                            <td>
                                <%=item.UserMobile%>
                            </td>
                            <td>
                                <%=item.AddDate%>
                            </td>
                            <td>
                                <input type="button" value="修改" style="width: 50px" id="edit" onclick="return edits(<%=item.Id%>)" />
                            </td>
                            <td>
                                <input type="button" value="删除" id="delete" style="width: 50px" onclick="del(<%=item.Id%>,this);" />
                            </td>
                        </tr>
                        <%}

                           }
                           else
                           {
                        %>
                        <tr>
                            <td colspan="10">
                                没有相关数据!
                            </td>
                        </tr>
                        <%
                            } %>
                    </table>
                </td>
            </tr>
            <tr>
                <td class="tdside" align="right">
                    <%=GetPage() %>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
